﻿namespace CN2P.ServiceModel.ServiceClients {
    using System.Configuration;

    public class ECommerceServiceClientConfiguration
    {

        public string SessionUri { get; set; }

        public string ProductsUri { get; set; }

        public string CartsUri { get; set; }

        public string RecommendationsUri { get; set; }

        public string OrdersUri { get; set; }

        public static ECommerceServiceClientConfiguration FromAppConfig()
        {
            var config = new ECommerceServiceClientConfiguration
            {
                SessionUri = ConfigurationManager.AppSettings["SessionUri"],
                ProductsUri = ConfigurationManager.AppSettings["ProductsUri"],
                CartsUri = ConfigurationManager.AppSettings["CartsUri"],
                RecommendationsUri = ConfigurationManager.AppSettings["RecommendationsUri"],
                OrdersUri = ConfigurationManager.AppSettings["OrdersUri"]
            };
            return config;
        }
    }
}
